package edu.kit.aifb.ldstream.learner.dao;

import java.io.Serializable;

import org.openrdf.model.URI;

import edu.kit.aifb.ldstream.stat.distrib.IDistribution;

public class PropertyDistributionResult implements Serializable{


	private static final long serialVersionUID = 4182366991814505643L;

	private Type className;
	private URI propName;
	private IDistribution distribution;

	public PropertyDistributionResult(Type className, URI propName, 
									IDistribution distribution) {
		this.className = className;
		this.propName = propName;
		this.distribution = distribution;
	}

	
	public int hashCode(){
		return this.className.hashCode() * this.propName.hashCode();
	}
	
	public boolean equals(Object o){
		if(o instanceof PropertyDistributionResult){
			PropertyDistributionResult pdr = (PropertyDistributionResult) o;
			if(pdr.className != null && pdr.className.equals(this.className)){
				if(pdr.propName != null && pdr.propName.equals(this.propName)){
					return true;
					// distribution should be the same
				}
			}
		}
		return false;
	}
	
	/**
	 * @return the className
	 */
	public Type getClassName() {
		return className;
	}

	/**
	 * @return the propName
	 */
	public URI getPropName() {
		return propName;
	}

	/**
	 * @return the distribution
	 */
	public IDistribution getDistribution() {
		return distribution;
	}


}
